import 'package:app/src/ui/route/clockin/clock_in_result_gongdan_qiantui.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aio/aio.dart';
import 'package:app/src/config/app_data_config.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/http/bean/wroks/product_bean.dart';
import 'package:app/src/http/bean/ywx_limit.dart';
import 'package:app/src/manager/audit_manager.dart';
import 'package:app/src/manager/user_manager.dart';
import 'package:app/src/ui/dialog/dailog.dart';
import 'package:app/src/ui/route/clockin/clock_in.dart';
import 'package:app/src/ui/route/config/server_address.dart';
import 'package:app/src/ui/route/main/search/search.dart';
import 'package:app/src/ui/route/sms/sms_mobile.dart';
import 'package:app/src/ui/route/user/login.dart';
import 'package:app/src/ui/route/user/password.dart';
import 'package:app/src/ui/route/works/auditaddress/auditaddress.dart';
import 'package:app/src/ui/route/works/auditaddress/auditaddress_details.dart';
import 'package:app/src/ui/route/works/contract/contract.dart';
import 'package:app/src/ui/route/works/contract/contract_details.dart';
import 'package:app/src/ui/route/works/contractoem/contractoem.dart';
import 'package:app/src/ui/route/works/contractoem/contractoem_details.dart';
import 'package:app/src/ui/route/works/deliverynotice/deliverynotice.dart';
import 'package:app/src/ui/route/works/deliverynotice/deliverynotice_details.dart';
import 'package:app/src/ui/route/works/order/order.dart';
import 'package:app/src/ui/route/works/order/order_details.dart';
import 'package:app/src/ui/route/works/orderdjchek/orderdjchek.dart';
import 'package:app/src/ui/route/works/orderdjchek/orderdjchek_details.dart';
import 'package:app/src/ui/route/works/orderschangefactory/orderschangefactory.dart';
import 'package:app/src/ui/route/works/orderschangefactory/orderschangefactory_details.dart';
import 'package:app/src/ui/route/works/payfree/payfree.dart';
import 'package:app/src/ui/route/works/payfree/payfree_details.dart';
import 'package:app/src/ui/route/works/payfreegoodreturn/payfreegoodreturn.dart';
import 'package:app/src/ui/route/works/payfreegoodreturn/payfreegoodreturn_details.dart';
import 'package:app/src/ui/route/works/paynotice/paynotice.dart';
import 'package:app/src/ui/route/works/paynotice/paynotice_details.dart';
import 'package:app/src/ui/route/works/public/product/product_info.dart';
import 'package:app/src/ui/route/works/receiptapply/receiptapply.dart';
import 'package:app/src/ui/route/works/receiptapply/receiptapply_details.dart';
import 'package:app/src/ui/route/works/type12_dispatchingaudit/dispatchingaudit_details.dart';
import 'package:app/src/ui/route/works/type13_carfreight_rates/carfreightrates.dart';
import 'package:app/src/ui/route/works/type13_carfreight_rates/carfreightrates_details.dart';
import '../../../../generated/app_strings.dart';
import '../../../http/bean/works_2023/contractroyaltyrateapplycheck_bean.dart';
import '../../../http/bean/works_2023/purcontract_bean.dart';
import '../../../http/bean/worksdo/equipment_management_bean.dart';
import '../../../http/bean/worksdo/hardware_return_bean.dart';
import '../../../http/bean/worksdo/material_requisition_bean.dart';
import '../../../manager/ywx_manager.dart';
import '../../../utils/image_path_utils.dart';
import '../clockin/clock_in_record.dart';
import '../clockin/clock_in_result.dart';
import '../main/main.dart';
import '../main/search/search_apply_name.dart';
import '../main/search/search_name.dart';
import '../main/search/search_project_name.dart';
import '../todo/todo.dart';
import '../works/contract/contract_details2.dart';
import '../works/type12_dispatchingaudit/dispatchingaudit.dart';
import '../works/type14_guaranteed_review/guaranteedreview.dart';
import '../works/type14_guaranteed_review/guaranteedreview_details.dart';
import '../works/type15_workreview/workreview.dart';
import '../works/type15_workreview/workreview_details.dart';
import '../works/type17_percentage_check/percentage_check .dart';
import '../works/type17_percentage_check/percentage_check_details.dart';
import '../works/type18_contract_royalty_rate_apply_check/changerecord/contractroyaltyrateapplycheck_changerecord.dart';
import '../works/type18_contract_royalty_rate_apply_check/contractroyaltyrateapplycheck.dart';
import '../works/type18_contract_royalty_rate_apply_check/contractroyaltyrateapplycheck_details.dart';
import '../works/type19_report_loss/report_loss.dart';
import '../works/type19_report_loss/report_loss_details.dart';
import '../works/type20_hardware_approval/hardware_approval.dart';
import '../works/type20_hardware_approval/hardware_approval_details.dart';
import '../works/type21_material_requisition/material_requisition_audit.dart';
import '../works/type21_material_requisition/material_requisition_audit_details.dart';
import '../works/type22_purorder/purorder_audit.dart';
import '../works/type22_purorder/purorder_audit_details.dart';
import '../works/type22_purorder/purorder_audit_details_log.dart';
import '../works/type23_purcontract/purcontract_audit.dart';
import '../works/type23_purcontract/purcontract_audit_details.dart';
import '../works/type23_purcontract/purcontract_audit_details_fujian.dart';
import '../works/type23_purcontract/purcontract_audit_details_history.dart';
import '../works/type24_transport/transport_audit.dart';
import '../works/type24_transport/transport_audit_details.dart';
import '../worksdo/type16_material_requisition/material_requisition.dart';
import '../worksdo/type16_material_requisition/material_requisition_details.dart';
import '../worksdo/type25_ticket_center/ticketcenter.dart';
import '../worksdo/type25_ticket_center/ticketcenter_details.dart';
import '../worksdo/type26_my_workorder/myworkorder.dart';
import '../worksdo/type26_my_workorder/myworkorder_details.dart';
import '../worksdo/type26_my_workorder/receipt/receipt_of_work_order.dart';
import '../worksdo/type26_my_workorder/treasury/treasury_list.dart';
import '../worksdo/type26_my_workorder/treasury/treasury_list_details.dart';

typedef _StringCallback = void Function(String? value);

///路由跳转
class AppRouteHelper extends LibRouteHelper {
  ///程序退出
  static void exit() {
    LibRouteHelper.exit();
  }

  ///路由出栈(关闭)。
  static void pop<T extends Object>(BuildContext context, [T? result]) {
    LibRouteHelper.pop(context, result);
  }

  ///路由入栈
  ///isEnableFastGo 是否开启，防止快速重复跳转。默认开启
  ///isReplacement true 跳转指定路由，并移除当前路由。
  ///isRemoveUntil true 跳转到指定路由，并移除其他所有路由。
  static Future<Object?>? push(BuildContext? context, Widget route,
      {bool isEnableFastGo = true,
      bool isReplacement = false,
      bool isRemoveUntil = false,
      bool isUnique = true}) async {
    return LibRouteHelper.push(context, route,
        isEnableFastGo: isEnableFastGo,
        isReplacement: isReplacement,
        isRemoveUntil: isRemoveUntil,
        isUnique: isUnique);
  }

  ///fixme 获取当前页面的路由。
  static String? getCurrentRoute() {
    return LibRouteHelper.getCurrentRoute();
  }

  //统一路由动画;这个重写，交给子类自己去实现。
  static PageRoute<Object> _goPageRoute(Widget route) {
    //fixme 这里传入的route才是我们实际页面的route
    //fixme route.runtimeType.toString() 一般都是该类的类名，如：MainRoute ，TodoRoute 等
    //LibRouteHelper.routes?.add(route.runtimeType.toString()); //fixme 路由添加到队列里。
    LibRouteHelper.addRoute(route);

    //print("AppRoute:$route\t${route.runtimeType.toString()}");
    //AppRoute:TodoRoute	TodoRoute
    //AppRoute:PayfreeDetailsRoute	PayfreeDetailsRoute
    //渐隐动画
    // return FadePageRoute(pageBuilder: (context, animation, secondaryAnimation) {
    //   return route; //路由
    // });
    //缩放动画
    //return ScaleRouter(child: route);
    //渐显动画
    //return FadeRouter(child: route);
    //旋转路由动画
    //return RotateRouter(child: route);
    //上--->下
    //return TopToBottomRouter(child: route);
    //下--->上
    //return BottomToTopRouter(child: route);
    //左--->右
    //return LeftToRightRouter(child: route);
    //右--->左
    // return RightToLeftRouter(child: route);
    //缩放+透明+旋转路由动画
    //return ScaleFadeRotateRouter(child: route);
    //fixme 无动画
    //return NoAnimRouter(route);
    //系统默认的跳转效果(效果还不错)
    // return MaterialPageRoute(builder: (context) {
    //   return route;
    // });
    //CupertinoPageRoute 苹果风格的跳转方式
    return CupertinoPageRoute(builder: (context) {
      return route;
    });
    // return PageRouteBuilder(pageBuilder: (context, animation, secondaryAnimation) {
    //   return route; //路由
    // });
  }

  ///跳转到主页面
  static void goMainRoute(BuildContext context, {bool isEnableFastGo = false}) {
    if (StringUtils.isEmpty(AppDataConfig.getAppSecret())) {
      goSerVerAddressRoute(context);
      return;
    }
    if (UserManager.getUserInfo() == null) {
      goLoginRoute(context, isEnableFastGo);
      return;
    }
    // push(context, _goPageRoute(MainRoute()), isRemoveUntil: true);
    push(context, MainRoute(), isRemoveUntil: true);
  }

  ///跳转到服务器地址
  static void goSerVerAddressRoute(BuildContext context,
      {bool isRemoveUntil = false}) {
    // push(context, _goPageRoute(SerVerAddressRoute()),
    //     isRemoveUntil: isRemoveUntil);
    push(context, SerVerAddressRoute(), isRemoveUntil: isRemoveUntil);
  }

  ///跳转到登录页面
  ///isEnableFastGo 是否开启快速防重复跳转
  static void goLoginRoute(BuildContext context, bool isEnableFastGo) {
    // push(context, _goPageRoute(LoginRoute()),
    //     isRemoveUntil: true, isEnableFastGo: isEnableFastGo);
    push(context, LoginRoute(),
        isRemoveUntil: true, isEnableFastGo: isEnableFastGo);
  }

  ///跳转到密码修改
  static void goPassWordRoute(BuildContext context) {
    if (!PassWordRoute.isShow) {
      //fixme 这里允许快速跳转。之前在首页没有自动跳转到密码修改页，就是因为这个快速跳转的问题。才没有跳。
      //isEnableFastGo true 开启快速跳转，不允许快速跳转； false 允许快速跳转。
      // push(context, _goPageRoute(PassWordRoute()), isEnableFastGo: false);
      push(context, PassWordRoute(), isEnableFastGo: false);
    }
  }

  ///跳转到主页搜索页面
  static void goSearchRoute(BuildContext context) {
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    // push(context, _goPageRoute(SearchRoute()));
    push(context, SearchRoute());
    // goSearchProjiectNameRoute(context, (value) {
    //   print("搜索结果:$value");
    // });
  }

  ///跳转到工程名称搜索页面;或品牌搜索页面
  static void goSearchProjiectNameRoute(
      BuildContext context,
      PreSearchMaterialInfo searchData,
      ResponseCallbackWithT responseCallbackWithT) {
    // push(
    //     context,
    //     _goPageRoute(
    //         SearchProjiectNameRoute(searchData, responseCallbackWithT)));
    push(context, SearchProjiectNameRoute(searchData, responseCallbackWithT));
  }

  ///跳转申请人搜索界面
  static void goSearchApplyNameRoute(
      BuildContext context, ResponseCallbackWithT responseCallbackWithT) {
    // push(context, _goPageRoute(SearchApplyNameRoute(responseCallbackWithT)));
    push(context, SearchApplyNameRoute(responseCallbackWithT));
  }

  ///跳转到名称搜索通用界面
  static void goSearchNameRoute(
      BuildContext context,
      List<RollerBean>? searchData,
      ResponseCallbackWithT responseCallbackWithT) {
    // push(context,
    //     _goPageRoute(SearchNameRoute(searchData, responseCallbackWithT)));
    push(context, SearchNameRoute(searchData, responseCallbackWithT));
  }

  ///跳转手机验证码界面
  static void goSmsMobileRoute(BuildContext context) {
    if (!SmsMobileRoute.isShow) {
      // push(context, _goPageRoute(SmsMobileRoute()));
      push(context, SmsMobileRoute());
    }
  }

  ///跳转打卡页面
  static void goClockinRoute(BuildContext context) {
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    PermissionUtils.request_location_alert(context, (value) {
      if (value) {
        // Toast.showInfo("即将开放", context);
        // return;
        //需要定位权限
        // push(context, _goPageRoute(ClockinRoute()));
        push(context, ClockinRoute());
      }
    });
  }

  ///跳转打卡结果页面
  ///isReplacement true 跳转指定路由，并移除当前路由。
  static void goClockinResultRoute(
    BuildContext context,
    String? MsgDetail, {
    bool isOffWork = false,
    bool is102 = true,
    bool isReplacement = true,
  }) {
    // goClockinResultGongdanRoute(context,"");
    ClockinResultRoute.isOffWork = isOffWork;
    ClockinResultRoute.MsgDetail = MsgDetail;
    ClockinResultRoute.is102 = is102;
    // push(context, _goPageRoute(ClockinResultRoute()),
    //     isReplacement: isReplacement);
    push(context, ClockinResultRoute(), isReplacement: isReplacement);
  }

  ///跳转打卡结果页面：有强制性工单，无法签退
  ///isReplacement true 跳转指定路由，并移除当前路由。
  static void goClockinResultGongdanRoute(
      BuildContext context,
      String? MsgDetail, {
        bool isOffWork = false,
        bool is102 = true,
        bool isReplacement = true,
      }) {
    ClockinResultRoute.isOffWork = isOffWork;
    ClockinResultRoute.MsgDetail = MsgDetail;
    ClockinResultRoute.is102 = is102;
    // push(context, _goPageRoute(ClockinResultRoute()),
    //     isReplacement: isReplacement);
    push(context, ClockinResultGongdanRoute(), isReplacement: isReplacement);
  }

  ///跳转打卡记录
  static void goClockinRecordRoute(
    BuildContext context, {
    bool isReplacement = false,
  }) {
    // push(context, _goPageRoute(ClockinRecordRoute()),
    //     isReplacement: isReplacement);
    push(context, ClockinRecordRoute(), isReplacement: isReplacement);
  }

  ///跳转到二维码扫描界面;回调返回扫码结果。
  ///color 二维码扫码界面的主题色
  static void goScanRoute(BuildContext context, _StringCallback callback,
      {Color color = Colors.blueAccent}) {
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    LibRouteHelper.goScanRoute(context, callback, color: color);
  }

  ///跳转到二维码扫描结果页面
  ///color 主题色
  static void goScanResultRoute(BuildContext? context, String? result,
      {Color color = Colors.blueAccent}) {
    LibRouteHelper.goScanResultRoute(context, result, color: color);
  }

  ///title 标题
  ///initialUrl 网页地址
  ///initialData html文本内容
  ///color 标题栏主题色
  static void goWebViewRoute(BuildContext? context,
      {String? title, String? initialUrl, String? initialData, Color? color}) {
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    LibRouteHelper.goWebViewRoute(context,
        title: title,
        initialUrl: initialUrl,
        initialData: initialData,
        color: color);
  }

  ///fixme 跳转验证
  ///isAuto 是否自动跳转
  static bool isValidation(BuildContext? context, {bool isAuto = true}) {
    if (context == null) {
      return false;
    }
    // return true;//fixme 验证通过；测试。
    if (!AppDataConfig.isValidation()) {
      //fixme 跳转到手机验证码验证界面。
      if (isAuto) {
        goSmsMobileRoute(context);
      }
      return false;
    }
    if (AppDataConfig.isValidationWithPassword()) {
      //fixme 跳转到密码修改
      if (isAuto) {
        AppRouteHelper.goPassWordRoute(context);
      }
      return false;
    }
    return true; //验证通过
  }

  ///跳转到待办事项(待审核列表)
  static void goTodo(BuildContext context) {
    // if (!AppDataConfig.isValidation()) {
    //   //fixme 跳转到手机验证码验证界面。
    //   goSmsMobileRoute(context);
    //   return;
    // }
    // if (AppDataConfig.isValidationWithPassword()) {
    //   //fixme 跳转到密码修改
    //   AppRouteHelper.goPassWordRoute(context);
    //   return;
    // }
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    // push(context, _goPageRoute(TodoRoute()));
    push(context, TodoRoute());
  }

  ///跳转到具体的功能项
  static void goWorks(BuildContext context, YwxItem item) {
    if (!isValidation(context)) {
      return; //fixme 验证没有通过
    }
    // if (!AppDataConfig.isValidation()) {
    //   //fixme 跳转到手机验证码验证界面。
    //   goSmsMobileRoute(context);
    //   return;
    // }
    // if (AppDataConfig.isValidationWithPassword()) {
    //   //fixme 跳转到密码修改
    //   AppRouteHelper.goPassWordRoute(context);
    //   return;
    // }
    if (ReviewType.Contract == item.ReviewType) {
      //合同审核
      goContractRoute(context, item);
    } else if (ReviewType.Order == item.ReviewType) {
      //订单审核
      goOrderRoute(context, item);
    } else if (ReviewType.Auditaddress == item.ReviewType) {
      //送货地址审核
      goAuditaddressRoute(context, item);
    } else if (ReviewType.ContractOem == item.ReviewType) {
      //合同特殊设置审核
      goContractOemRoute(context, item);
    } else if (ReviewType.OrderDJchek == item.ReviewType) {
      //冻结解冻审核
      goOrderDJchekRoute(context, item);
    } else if (ReviewType.OrdersChangeFactory == item.ReviewType) {
      //工厂更换审核
      goOrdersChangeFactoryRoute(context, item);
    } else if (ReviewType.DeliveryNotice == item.ReviewType) {
      //发货审核
      goDeliveryNoticeRoute(context, item);
    } else if (ReviewType.PayFreeGoodReturn == item.ReviewType) {
      //退货审核
      goPayFreeGoodReturnRoute(context, item);
    } else if (ReviewType.ReceiptApply == item.ReviewType) {
      //开票审核
      goReceiptApplyRoute(context, item);
    } else if (ReviewType.Paynotice == item.ReviewType) {
      //确认收款
      goPaynoticeRoute(context, item);
    } else if (ReviewType.PayFree == item.ReviewType) {
      //免款审核
      goPayFreeRoute(context, item);
    } else if (ReviewType.OtherWorkApplyDoList == item.ReviewType) {
      //派工审核
      goDispatchingauditRoute(context, item);
    } else if (ReviewType.CarFreightRates == item.ReviewType) {
      //外车运费审核
      goCarFreightRatesRoute(context, item);
    } else if (ReviewType.GuaranteedReview == item.ReviewType) {
      //保底审核
      goGuaranteedReviewRoute(context, item);
    } else if (ReviewType.WorkReview == item.ReviewType) {
      //加班审核
      goWorkReviewRoute(context, item);
    } else if (ReviewType.PercentageCheck == item.ReviewType) {
      //提成审核
      goPercentageCheckRoute(context, item);
    } else if (ReviewType.ContractRoyaltyRateApplyCheck == item.ReviewType) {
      //提成比例审核
      goContractRoyaltyRateApplyCheckRoute(context, item);
    } else if (ReviewType.TicketCenter == item.ReviewType &&
        AppStrings.of(context).Ticket_center == item.YwxName) {
      //工单中心
      // //fixme 这里工单中心复制是物料请购里的，所以这里参数模拟物料请购里的。
      // item.ReviewType2 = ReviewType.MaterialRequisition_OriginalRequisition;
      // item.YwxName2 = AppStrings.of(context).OriginalRequisition;
      goTicketCenterRoute(context, item);
    } else if (ReviewType.Myworkorder == item.ReviewType &&
        AppStrings.of(context).Myworkorder == item.YwxName) {
      //我的工单
      // //fixme 这里工单中心复制是物料请购里的，所以这里参数模拟物料请购里的。
      // item.ReviewType2 = ReviewType.MaterialRequisition_OriginalRequisition;
      // item.YwxName2 = AppStrings.of(context).OriginalRequisition;
      goMyworkorderRoute(context, item);
    } else if (ReviewType.MaterialRequisition == item.ReviewType) {
      //物料请购
      AppDialog.showDialogWithPickerMaterialRequisition(context, item, () {
        goMaterialRequisitionRoute(context, item);
      });
    } else if (ReviewType.LoseApplySure == item.ReviewType) {
      //报损审核
      goReportLossRoute(context, item);
    } else if (ReviewType.MaterialReview == item.ReviewType) {
      //五金领用审核
      goHardwareApprovalRoute(context, item);
    } else if (ReviewType.GetPurDemandList == item.ReviewType ||
        ReviewType.GetPurDemandListMT02 == item.ReviewType ||
        ReviewType.GetPurDemandListMT03 == item.ReviewType) {
      //请购单审核
      goMaterialRequisitionAuditRoute(context, item);
    } else if (ReviewType.GetPurOrder == item.ReviewType ||
        ReviewType.GetPurOrderMT02 == item.ReviewType ||
        ReviewType.GetPurOrderMT03 == item.ReviewType) {
      //采购单审核
      goPurOrderAuditRoute(context, item);
    } else if (ReviewType.GetPurContract == item.ReviewType ||
        ReviewType.GetPurContractMT02 == item.ReviewType ||
        ReviewType.GetPurContractMT03 == item.ReviewType) {
      //采购合同审核
      goPurContractAuditRoute(context, item);
    } else if (ReviewType.GetLogisticsContract == item.ReviewType) {
      //运输合同审核
      goTransportAuditRoute(context, item);
    }
  }

  // String? ReviewType=widget.item.ReviewType;
  // String? YwxId=widget.item.YwxId;
  // YwxItem? item=YwxIdManager.getYwxItem(context,ReviewType: ReviewType,YwxId: YwxId);
  // bool? IsApproval=data.isApproval();
  // String? ReviewTypeId=data.ReviewTypeId;
  // AppRouteHelper.goWorksDetails2(context, item,IsApproval,ReviewTypeId,data: null)
  //     ?.then((value) {
  //   if (value != null) {
  //     AppUi.easyRefreshcallRefresh(_controller); //重新刷新。
  //   }
  // });
  ///跳转到具体的功能项，详情页面
  ///IsApproval 判断审核类型是否已经审核
  ///ReviewTypeId 列表传递给详情页的id;详情页提交的id；审核id;
  static Future<Object?>? goWorksDetails2(
      BuildContext? context,
      YwxItem? item,
      bool? IsApproval,
      String? ReviewTypeId,
      String? ApprovalState,
      String? YwxId,
      String? YwxName,
      {ContractCopyInfo? data = null,
      Auditmaterial? material = null}) {
    if (item == null || context == null) {
      return null;
    }

    if (!isValidation(context)) {
      //return; //fixme 验证没有通过
      return Future.value(null);
    }

    AuditManager.getAuditManager().item = item;
    AuditManager.getAuditManager().IsApproval = IsApproval ?? false;
    AuditManager.getAuditManager().ApprovalState = ApprovalState;
    AuditManager.getAuditManager().YwxId = YwxId;
    AuditManager.getAuditManager().YwxName = YwxName;
    AuditManager.getAuditManager().material = material;
    //AuditManager.IsBack = data.isBack();
    AuditManager.getAuditManager().ReviewTypeId = ReviewTypeId;
    AuditManager.getAuditManager().BodyId = data?.BodyId ?? "";
    var auditManager = AuditManager.getAuditManager();
    if (ReviewType.Contract == item.ReviewType) {
      //合同审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.ContractId;
      }
      return goContractDetailsRoute(context);
    } else if (ReviewType.Order == item.ReviewType) {
      //订单审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.OrderCode;
      }
      return goOrderDetailsRoute(context);
    } else if (ReviewType.Auditaddress == item.ReviewType) {
      //送货地址审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.FaId;
      }
      return goAuditaddressDetailsRoute(context);
    } else if (ReviewType.ContractOem == item.ReviewType) {
      //合同特殊设置审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.OdId;
      }
      return goContractOemDetailsRoute(context);
    } else if (ReviewType.OrderDJchek == item.ReviewType) {
      //冻结解冻审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.OrderCode;
      }
      return goOrderDJchekDetailsRoute(context);
    } else if (ReviewType.OrdersChangeFactory == item.ReviewType) {
      //工厂更换审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.OrderCode;
      }
      return goOrdersChangeFactoryDetailsRoute(context);
    } else if (ReviewType.DeliveryNotice == item.ReviewType) {
      //发货审核详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data?.NId;
      }
      return goDeliveryNoticeDetailsRoute(context);
    } else if (ReviewType.PayFreeGoodReturn == item.ReviewType) {
      //退货审核详情
      return goPayFreeGoodReturnDetailsRoute(context);
    } else if (ReviewType.ReceiptApply == item.ReviewType) {
      //开票审核详情
      return goReceiptApplyDetailsRoute(context);
    } else if (ReviewType.Paynotice == item.ReviewType) {
      //确认收款详情
      if (StringUtils.isEmpty(auditManager.ReviewTypeId) && data != null) {
        auditManager.ReviewTypeId = data.NoticeId;
      }
      return goPaynoticeDetailsRoute(context);
    } else if (ReviewType.PayFree == item.ReviewType) {
      //免款审核详情
      return goPayfreeDetailsRoute(context);
    } else if (ReviewType.OtherWorkApplyDoList == item.ReviewType) {
      //派工审核详情
      return goDispatchingauditDetailsRoute(context);
    } else if (ReviewType.CarFreightRates == item.ReviewType) {
      //外车运费审核详情
      return goCarFreightRatesDetailsRoute(context);
    } else if (ReviewType.GuaranteedReview == item.ReviewType) {
      //保底审核详情
      return goGuaranteedReviewDetailsRoute(context);
    } else if (ReviewType.WorkReview == item.ReviewType) {
      //加班审核详情
      return goWorkReviewDetailsRoute(context);
    } else if (ReviewType.PercentageCheck == item.ReviewType) {
      //提成审核详情
      return goPercentageCheckDetailsRoute(context);
    } else if (ReviewType.ContractRoyaltyRateApplyCheck == item.ReviewType) {
      //提成比例审核详情
      return goContractRoyaltyRateApplyCheckDetailsRoute(context, item);
    } else if (ReviewType.LoseApplySure == item.ReviewType) {
      //报损审核详情
      return goReportLossDetailsRoute(context, item);
    } else if (ReviewType.MaterialReview == item.ReviewType) {
      //五金领用审核详情
      return goHardwareApprovalDetailsRoute(context, item);
    } else if (ReviewType.GetPurDemandList == item.ReviewType ||
        ReviewType.GetPurDemandListMT02 == item.ReviewType ||
        ReviewType.GetPurDemandListMT03 == item.ReviewType) {
      //请购单审核详情
      return goMaterialRequisitionAuditDetailsRoute(context, item);
    } else if (ReviewType.GetPurOrder == item.ReviewType ||
        ReviewType.GetPurOrderMT02 == item.ReviewType ||
        ReviewType.GetPurOrderMT03 == item.ReviewType) {
      //采购单审核详情
      return goPurOrderAuditDetailsRoute(context, item);
    } else if (ReviewType.GetPurContract == item.ReviewType ||
        ReviewType.GetPurContractMT02 == item.ReviewType ||
        ReviewType.GetPurContractMT03 == item.ReviewType) {
      //采购合同审核详情
      return goPurContractAuditDetailsRoute(context, item);
    } else if (ReviewType.GetLogisticsContract == item.ReviewType) {
      //运输合同审核详情
      return goTransportAuditDetailsRoute(context, item);
    }
    return Future.value(null);
  }

  ///非审核类详情页跳转
  static Future<Object?>? goWorksDetails3(BuildContext? context, YwxItem item,
      {MaterialInfo? materialInfo = null}) {
    if (context == null) {
      return Future.value(null);
    }
    if (ReviewType.TicketCenter == item.ReviewType &&
        AppStrings.of(context).Ticket_center == item.YwxName) {
      ///工单中心详情
      // return goTicketCenterDetailsRoute(context!, materialInfo!);
    } else if (ReviewType.Myworkorder == item.ReviewType &&
        AppStrings.of(context).Myworkorder == item.YwxName) {
      // ///我的工单详情
      // return goMyworkorderDetailsRoute(context!, materialInfo!, item);
    } else if (ReviewType.MaterialRequisition == item.ReviewType ||
        ReviewType.MaterialRequisition_OriginalRequisition ==
            item.ReviewType2 ||
        ReviewType.MaterialRequisition_AccessoriesRequisition ==
            item.ReviewType2 ||
        ReviewType.MaterialRequisition_HardwareRequisition ==
            item.ReviewType2 ||
        ReviewType.MaterialRequisition_Generated == item.ReviewType2) {
      //物料请购详情
      return goMaterialRequisitionDetailsRoute(context!, materialInfo!);
    }
    return Future.value(null);
  }

  ///跳转到具体的功能项，详情页面
  static Future<Object?>? goWorksDetails(
      BuildContext context, YwxItem? item, ContractCopyInfo data,
      {Auditmaterial? material = null}) {
    return goWorksDetails2(context, item, data.isApproval(), data.ReviewTypeId,
        data?.ApprovalState, data?.YwxId, data?.YwxName,
        data: data, material: material);
    // AuditManager.item = item;
    // AuditManager.IsApproval = data.isApproval();
    // //AuditManager.IsBack = data.isBack();
    // AuditManager.ReviewTypeId = data.ReviewTypeId;
    // if (ReviewType.Contract == item.ReviewType) {
    //   //合同审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.ContractId;
    //   }
    //   return goContractDetailsRoute(context);
    // } else if (ReviewType.Order == item.ReviewType) {
    //   //订单审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.OrderCode;
    //   }
    //   return goOrderDetailsRoute(context);
    // } else if (ReviewType.Auditaddress == item.ReviewType) {
    //   //送货地址审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.FaId;
    //   }
    //   return goAuditaddressDetailsRoute(context);
    // } else if (ReviewType.ContractOem == item.ReviewType) {
    //   //合同特殊设置审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.OdId;
    //   }
    //   return goContractOemDetailsRoute(context);
    // } else if (ReviewType.OrderDJchek == item.ReviewType) {
    //   //冻结解冻审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.OrderCode;
    //   }
    //   return goOrderDJchekDetailsRoute(context);
    // } else if (ReviewType.OrdersChangeFactory == item.ReviewType) {
    //   //工厂更换审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.OrderCode;
    //   }
    //   return goOrdersChangeFactoryDetailsRoute(context);
    // } else if (ReviewType.DeliveryNotice == item.ReviewType) {
    //   //发货审核详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.NId;
    //   }
    //   return goDeliveryNoticeDetailsRoute(context);
    // } else if (ReviewType.PayFreeGoodReturn == item.ReviewType) {
    //   //退货审核详情
    //   return goPayFreeGoodReturnDetailsRoute(context);
    // } else if (ReviewType.ReceiptApply == item.ReviewType) {
    //   //开票审核详情
    //   return goReceiptApplyDetailsRoute(context);
    // } else if (ReviewType.Paynotice == item.ReviewType) {
    //   //确认收款详情
    //   if (StringUtils.isEmpty(AuditManager.ReviewTypeId)) {
    //     AuditManager.ReviewTypeId = data.NoticeId;
    //   }
    //   return goPaynoticeDetailsRoute(context);
    // } else if (ReviewType.PayFree == item.ReviewType) {
    //   //免款审核详情
    //   return goPayfreeDetailsRoute(context);
    // }
    // return Future.value(null);
  }

  ///合同审核
  static void goContractRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(ContractRoute(item)));
    push(context, ContractRoute(item));
  }

  ///合同审核详情
  static Future<Object?>? goContractDetailsRoute(BuildContext context,
      {bool onlyBack = false}) {
    // return push(
    //     context,
    //     _goPageRoute(ContractDetailsRoute(
    //       onlyBack: onlyBack,
    //     )));
    return push(
        context,
        ContractDetailsRoute(
          onlyBack: onlyBack,
        ));
  }

  ///合同审核详情2（提成比例审核跳转过来的）
  static Future<Object?>? goContractDetailsRoute2(
      BuildContext context,
      String ContractCode,
      String ContractId,
      ContractRoyaltyRateApplyCheckBean? ContractRoyaltyRateApplyCheck,
      {bool onlyBack = false}) {
    // return push(
    //     context,
    //     _goPageRoute(ContractDetailsRoute2(ContractCode, ContractId, onlyBack,
    //         ContractRoyaltyRateApplyCheck)));
    return push(
        context,
        ContractDetailsRoute2(
            ContractCode, ContractId, onlyBack, ContractRoyaltyRateApplyCheck));
  }

  ///订单审核
  static void goOrderRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(OrderRoute(item)));
    push(context, OrderRoute(item));
  }

  ///订单审核详情
  static Future<Object?>? goOrderDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(OrderDetailsRoute()));
    return push(context, OrderDetailsRoute());
  }

  ///送货地址审核
  static void goAuditaddressRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(AuditaddressRoute(item)));
    push(context, AuditaddressRoute(item));
  }

  ///送货地址审核详情
  static Future<Object?>? goAuditaddressDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(AuditaddressDetailsRoute()));
    return push(context, AuditaddressDetailsRoute());
  }

  ///合同特殊设置审核
  static void goContractOemRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(ContractOemRoute(item)));
    push(context, ContractOemRoute(item));
  }

  ///合同特殊设置审核详情
  static Future<Object?>? goContractOemDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(ContractOemDetailsRoute()));
    return push(context, ContractOemDetailsRoute());
  }

  ///冻结解冻审核
  static void goOrderDJchekRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(OrderDJchekRoute(item)));
    push(context, OrderDJchekRoute(item));
  }

  ///冻结解冻审核详情
  static Future<Object?>? goOrderDJchekDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(OrderDJchekDetailsRoute()));
    return push(context, OrderDJchekDetailsRoute());
  }

  ///工厂更换审核
  static void goOrdersChangeFactoryRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(OrdersChangeFactoryRoute(item)));
    push(context, OrdersChangeFactoryRoute(item));
  }

  ///工厂更换审核详情
  static Future<Object?>? goOrdersChangeFactoryDetailsRoute(
      BuildContext context) {
    // return push(context, _goPageRoute(OrdersChangeFactoryDetailsRoute()));
    return push(context, OrdersChangeFactoryDetailsRoute());
  }

  ///发货审核
  static void goDeliveryNoticeRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(DeliveryNoticeRoute(item)));
    push(context, DeliveryNoticeRoute(item));
  }

  ///发货审核详情
  static Future<Object?>? goDeliveryNoticeDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(DeliveryNoticeDetailsRoute()));
    return push(context, DeliveryNoticeDetailsRoute());
  }

  ///退货审核
  static void goPayFreeGoodReturnRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(PayFreeGoodReturnRoute(item)));
    push(context, PayFreeGoodReturnRoute(item));
  }

  ///退货审核详情
  static Future<Object?>? goPayFreeGoodReturnDetailsRoute(
      BuildContext context) {
    // return push(context, _goPageRoute(PayFreeGoodReturnDetailsRoute()));
    return push(context, PayFreeGoodReturnDetailsRoute());
  }

  ///开票审核
  static void goReceiptApplyRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(ReceiptApplyRoute(item)));
    push(context, ReceiptApplyRoute(item));
  }

  ///开票审核详情
  static Future<Object?>? goReceiptApplyDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(ReceiptApplyDetailsRoute()));
    return push(context, ReceiptApplyDetailsRoute());
  }

  ///确认收款
  static void goPaynoticeRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(PaynoticeRoute(item)));
    push(context, PaynoticeRoute(item));
  }

  ///确认收款详情
  static Future<Object?>? goPaynoticeDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(PaynoticeDetailsRoute()));
    return push(context, PaynoticeDetailsRoute());
  }

  ///免款审核
  static void goPayFreeRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(PayFreeRoute(item)));
    push(context, PayFreeRoute(item));
  }

  ///免款审核详情
  static Future<Object?>? goPayfreeDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(PayfreeDetailsRoute()));
    return push(context, PayfreeDetailsRoute());
  }

  ///派工审核
  static void goDispatchingauditRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(DispatchingauditRoute(item)));
    push(context, DispatchingauditRoute(item));
  }

  ///派工审核详情
  static Future<Object?>? goDispatchingauditDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(DispatchingauditDetailsRoute()));
    return push(context, DispatchingauditDetailsRoute());
  }

  ///外车运费审核
  static void goCarFreightRatesRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(CarFreightRatesRoute(item)));
    push(context, CarFreightRatesRoute(item));
  }

  ///外车运费审核详情
  static Future<Object?>? goCarFreightRatesDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(CarFreightRatesDetailsRoute()));
    return push(context, CarFreightRatesDetailsRoute());
  }

  ///保底审核
  static void goGuaranteedReviewRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(GuaranteedReviewRoute(item)));
    push(context, GuaranteedReviewRoute(item));
  }

  ///保底审核详情
  static Future<Object?>? goGuaranteedReviewDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(GuaranteedReviewDetailsRoute()));
    return push(context, GuaranteedReviewDetailsRoute());
  }

  ///加班审核
  static void goWorkReviewRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(WorkReviewRoute(item)));
    push(context, WorkReviewRoute(item));
  }

  ///加班审核详情
  static Future<Object?>? goWorkReviewDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(WorkReviewDetailsRoute()));
    return push(context, WorkReviewDetailsRoute());
  }

  ///提成审核
  static Future<Object?>? goPercentageCheckRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(PercentageCheckRoute(item)));
    return push(context, PercentageCheckRoute(item));
  }

  ///提成审核详情
  static Future<Object?>? goPercentageCheckDetailsRoute(BuildContext context) {
    // return push(context, _goPageRoute(PercentageCheckDetailsRoute()));
    return push(context, PercentageCheckDetailsRoute());
  }

  ///提成比例审核
  static Future<Object?>? goContractRoyaltyRateApplyCheckRoute(
      BuildContext context, YwxItem item) {
    // return push(
    //     context, _goPageRoute(ContractRoyaltyRateApplyCheckRoute(item)));
    return push(context, ContractRoyaltyRateApplyCheckRoute(item));
  }

  ///提成比例审核详情
  static Future<Object?>? goContractRoyaltyRateApplyCheckDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(
    //     context, _goPageRoute(ContractRoyaltyRateApplyCheckDetailsRoute(item)));
    return push(context, ContractRoyaltyRateApplyCheckDetailsRoute(item));
  }

  ///提成比例审核:更改记录
  ///ContractCode 合同编号
  static Future<Object?>? goContractRoyaltyRateApplyCheckChangeRecordRoute(
      BuildContext context, String? ContractCode) {
    YwxItem item = YwxItem(
        YwxId: YwxIdManager.N4029_0,
        ReviewType: ReviewType.ContractRoyaltyRateApplyCheck,
        YwxName: AppStrings.of(context).Recordcontractcommissions,
        //合同提成比例记录
        ImagePath: ImagePathUtils.getPathWithImageItem('ic_work_018.png'),
        LimitYwxId: ["N4029_1"]);
    item.changerecord = true; //更改记录标识
    // return push(
    //     context,
    //     _goPageRoute(ContractRoyaltyRateApplyCheckChangeRecordRoute(
    //         item, ContractCode)));
    return push(context,
        ContractRoyaltyRateApplyCheckChangeRecordRoute(item, ContractCode));
  }

  ///报损审核
  static Future<Object?>? goReportLossRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(ReportLossRoute(item)));
    return push(context, ReportLossRoute(item));
  }

  ///报损审核详情
  static Future<Object?>? goReportLossDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(ReportLossDetailsRoute(item)));
    return push(context, ReportLossDetailsRoute(item));
  }

  ///五金领用审核
  static Future<Object?>? goHardwareApprovalRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(HardwareApprovalRoute(item)));
    return push(context, HardwareApprovalRoute(item));
  }

  ///五金领用审核详情
  static Future<Object?>? goHardwareApprovalDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(HardwareApprovalDetailsRoute(item)));
    return push(context, HardwareApprovalDetailsRoute(item));
  }

  ///请购单审核
  static Future<Object?>? goMaterialRequisitionAuditRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(MaterialRequisitionAuditRoute(item)));
    return push(context, MaterialRequisitionAuditRoute(item));
  }

  ///请购单审核详情
  static Future<Object?>? goMaterialRequisitionAuditDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(
    //     context, _goPageRoute(MaterialRequisitionAuditDetailsRoute(item)));
    return push(context, MaterialRequisitionAuditDetailsRoute(item));
  }

  ///采购单审核
  static Future<Object?>? goPurOrderAuditRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(PurOrderAuditRoute(item)));
    return push(context, PurOrderAuditRoute(item));
  }

  ///请购单审核详情
  static Future<Object?>? goPurOrderAuditDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(PurOrderAuditDetailsRoute(item)));
    return push(context, PurOrderAuditDetailsRoute(item));
  }

  ///请购单审核详情:请购日志
  static Future<Object?>? goPurOrderAuditDetailsLogRoute(
      BuildContext context, YwxItem item, List<WFLog>? WFLogList) {
    // return push(
    //     context, _goPageRoute(PurOrderAuditDetailsLogRoute(item, WFLogList)));

    return push(context, PurOrderAuditDetailsLogRoute(item, WFLogList));
  }

  ///采购合同审核
  static Future<Object?>? goPurContractAuditRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(PurContractAuditRoute(item)));
    return push(context, PurContractAuditRoute(item));
  }

  ///采购合同审核详情
  static Future<Object?>? goPurContractAuditDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(PurContractAuditDetailsRoute(item)));
    return push(context, PurContractAuditDetailsRoute(item));
  }

  ///采购合同审核详情：查看附件
  static Future<Object?>? goPurcontractAuditDetailsFujianRoute(
      BuildContext context, YwxItem item, List<String>? data) {
    // return push(
    //     context, _goPageRoute(PurcontractAuditDetailsFujianRoute(item, data)));
    return push(context, PurcontractAuditDetailsFujianRoute(item, data));
  }

  ///采购合同审核详情：查看历史合同
  static Future<Object?>? goPurcontractAuditDetailsHistoryRoute(
      BuildContext context, YwxItem item, PurContractBean? data) {
    // return push(
    //     context, _goPageRoute(PurcontractAuditDetailsHistoryRoute(item, data)));
    return push(context, PurcontractAuditDetailsHistoryRoute(item, data));
  }

  ///运输合同审核
  static Future<Object?>? goTransportAuditRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(TransportAuditRoute(item)));
    return push(context, TransportAuditRoute(item));
  }

  ///运输合同审核详情
  static Future<Object?>? goTransportAuditDetailsRoute(
      BuildContext context, YwxItem item) {
    // return push(context, _goPageRoute(TransportAuditDetailsRoute(item)));
    return push(context, TransportAuditDetailsRoute(item));
  }

  ///物料请购
  static void goMaterialRequisitionRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(MaterialRequisitionRoute(item)));
    push(context, MaterialRequisitionRoute(item));
  }

  ///物料请购详情
  static Future<Object?>? goMaterialRequisitionDetailsRoute(
      BuildContext context, MaterialInfo materialInfo) {
    // return push(
    //     context, _goPageRoute(MaterialRequisitionDetailsRoute(materialInfo)));
    return push(context, MaterialRequisitionDetailsRoute(materialInfo));
  }

  ///合同审核->产品信息
  ///bool isContractoryalty = false; //是否为提成比例审核跳转过来的产品信息
  static void goProductInfoRoute(BuildContext context, Product data,
      Product? oldData, bool isContractoryalty) {
    // push(context,
    //     _goPageRoute(ProductInfoRoute(data, oldData, isContractoryalty)));
    push(context, ProductInfoRoute(data, oldData, isContractoryalty));
  }

  ///工单中心
  static void goTicketCenterRoute(BuildContext context, YwxItem item) {
    // push(context, _goPageRoute(TicketCenterRoute(item)));
    push(context, TicketCenterRoute(item));
  }

  ///工单中心详情
  static Future<Object?>? goTicketCenterDetailsRoute(
      BuildContext context, EquipmentInfo? equipmentInfo) {
    // return push(context, _goPageRoute(TicketCenterDetailsRoute(equipmentInfo)));
    return push(context, TicketCenterDetailsRoute(equipmentInfo));
  }

  ///我的工单
  ///DeviceCoding 设备编码；首页二维码扫描。根据设备号，自动跳转到对应的工单。
  static void goMyworkorderRoute(BuildContext context, YwxItem item,
      {String? DeviceCoding}) {
    // push(
    //     context,
    //     _goPageRoute(MyworkorderRoute(
    //       item,
    //       // DeviceCoding: DeviceCoding,
    //     )));
    push(
        context,
        MyworkorderRoute(
          item,
          // DeviceCoding: DeviceCoding,
        ));
  }

  ///我的工单详情
  static Future<Object?>? goMyworkorderDetailsRoute(
      BuildContext context, EquipmentInfo? data, YwxItem item) {
    // return push(context, _goPageRoute(MyworkorderDetailsRoute(data, item)));
    return push(context, MyworkorderDetailsRoute(data, item));
  }

  ///我的工单详情 -> 工单领用（五金领用）
  static Future<Object?>? goReceiptofworkorderRoute(
      BuildContext context, EquipmentInfo materialInfo) {
    // return push(context, _goPageRoute(ReceiptofworkorderRoute(materialInfo)));
    return push(context, ReceiptofworkorderRoute(materialInfo));
  }

  ///我的工单-> 工单领用(领用记录)
  static void goTreasuryListRoute(
      BuildContext context, YwxItem item, EquipmentInfo equipmentInfo) {
    // push(context, _goPageRoute(TreasuryListRoute(item, equipmentInfo)));
    push(context, TreasuryListRoute(item, equipmentInfo));
  }

  ///我的工单-> 工单领用(领用记录详情)
  static Future<Object?>? goTreasuryListDetailsRoute(
      BuildContext context,
      EquipmentInfo? equipmentInfo,
      HardwareReturnListBean? hardwareReturnListBean) {
    // return push(
    //     context,
    //     _goPageRoute(
    //         TreasuryListDetailsRoute(equipmentInfo, hardwareReturnListBean)));
    return push(context,
        TreasuryListDetailsRoute(equipmentInfo, hardwareReturnListBean));
  }

  ///跳转到图片预览（单张图片）
  static void goPreviewImageRoute(BuildContext? context, String? imagePath) {
    LibRouteHelper.goPreviewImageRoute(context, imagePath);
  }

  ///跳转到图片预览（多张图片）
  static void goPreviewImagesRoute(
      BuildContext? context, List<String>? imagePaths,
      {int index = 0}) {
    LibRouteHelper.goPreviewImagesRoute(context, imagePaths, index: index);
  }

  ///跳转到桌面
  static void goHome(BuildContext? context) {
    LibRouteHelper.goHome(context);
  }
}
